package com.example.demo.common.enums;

/**
 * 个体工商户办理状态
 */
public enum ProcessStatusEnum {
    NOT_HANDLED("1","未办理"),
    IN_PROCESS("2","办理中"),
    HANDLED("3","已办理"),
    REJECTED("4","被驳回"),
    SELF_CANCEL("5","已注销");
    private String code;    //代码
    private String msg;    //描述

    ProcessStatusEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ProcessStatusEnum getProcessStatusEnum(String code) {
        for (ProcessStatusEnum j : ProcessStatusEnum.values()) {
            if (j.getCode().equals(code)) {
                return j;
            }
        }
        return null;
    }


    public boolean toEquals(Object code) {
        if (code == null) {
            return false;
        }
        String temp = String.valueOf(code);
        return this.code.equals(temp) ;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
